package com.example.car;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.*;
import android.widget.Button;
import android.widget.TabHost;

public class HomeActivity extends Activity implements View.OnClickListener {

	Button btn_start;
	Button btn_getpro;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home);
		btn_start = (Button)findViewById(R.id.btn_start);
		btn_start.setOnClickListener(this);
		btn_getpro = (Button)findViewById(R.id.btn_getpro);
		btn_getpro.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_home, menu);
		return true;
	}

	@Override
	public void onClick(View v) {
		int id = v.getId();
		//Log.d("LOG", "onclick = " + id);
		switch(id)
		{
			case R.id.btn_start:
				Log.d("LOG", "onclick start ");
				TabHost tabHost = (TabHost) getParent().findViewById(android.R.id.tabhost);
	            tabHost.setCurrentTab(1);
				break;
			case R.id.btn_getpro:
				Log.d("LOG", "onclick getpro ");
				break;
			default:
				break;
		}
	}

}
